package Annotation;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class TestRun {
	public static void main(String[] args) {
		Class<Test> c = Test.class;
		Method[] ms = c.getDeclaredMethods();
		for (Method method : ms) {
			
			if(method.isAnnotationPresent(TestAnnotation.class)){
				TestAnnotation t = method.getAnnotation(TestAnnotation.class);
				
				int num = t.value();
				System.out.println(num);
				try {
					method.invoke(c.newInstance());
				} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
						| InstantiationException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}
}
